<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script src="../fordate/vue_data.js"></script>
<script src="../fordate/index_date.js"></script>
<script src="../plugins/echarts/echarts.js"></script>
<!--<link type="text/css" rel="styleSheet"  href="../fordate/index_data.css" />-->
<link rel="stylesheet" href="../plugins/elementui/index.css">
<link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="../css/style.css">
<script src="../js/vue.js"></script>

<div id="app">
    <div class="content-header">
        <h1>统计分析<small>会员数量</small></h1>
        <el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb">
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item>统计分析</el-breadcrumb-item>
            <el-breadcrumb-item>会员数量</el-breadcrumb-item>
        </el-breadcrumb>
    </div>



    <div class="app-container">
        <div class="box">
            <!-- 为 ECharts 准备一个具备大小（宽高）的 DOM -->
            <div id="chart1" style="height:600px;"></div>
        </div>
    </div>
    <div>
        开始时间 <input id="startTime" type="text" placeholder="yyyy--mm" v-model="startTime">
        结束时间 <input id="endTime" type="text" placeholder="yyyy--mm" v-model="endTime">
        <input type="button" value="查询" @click="getTime">
    </div>
</div>
<!--<script src="../fordate/data.js"></script>-->

<script src="../js/axios-0.18.0.js"></script>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script type="text/javascript">


    var vue = new Vue({
        el: '#app',
        data: {
            startTime:'',
            endTime:''
        },
        created(){
            this.initPaint();
        },
        methods: {
            getTime() {
                axios.get("http://localhost:9002/report/getMemberReport.do").then((res) => {
                    // if (res.data.flag) {
                    //     //myChart1.setOption();
                    //     memberOption.xAxis.data = res.data.data.months;
                    //     memberOption.series[0].data = res.data.data.memberCount;
                    //     myChart1.clear();
                    //     myChart1.setOption(memberOption);
                    // }
                });
            },
            initPaint(){
                // 基于准备好的dom，初始化echarts实例

                var myChart1 = echarts.init(document.getElementById('chart1'));
                alert(123)
                // 使用刚指定的配置项和数据显示图表。

                myChart1.setOption({
                    title: {
                        text: '会员数量'
                    },
                    tooltip: {},
                    legend: {
                        data: ['会员数量']
                    },
                    xAxis: {
                        type: 'category',
                        data: ["2018.01", "2018.02", "2018.03", "2018.04"]
                    },
                    yAxis: {
                        type: 'value'
                    },
                    series: [{
                        name: '会员数量',
                        type: 'line',
                        data: [13, 14, 28, 30]
                    }]
                });
            }
    }
    })
</script>
</body>
</html>